package com.ccrfid.rmc6.service.auth;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.resource.auth.pojo.UserPrincipal;

import javax.servlet.http.HttpServletRequest;

public interface AuthenticationService {
    //验证用户名/密码
    Boolean authenticate(String userAccount, String password) throws AppException;
    //发布访问令牌
    String issueToken(String userAccount);
    //验证token有效性
    boolean validateToken(String token);
    //解析token
    UserPrincipal getUserPrincipal(String token);
    //验证用户登录ip
    boolean issueIp(String userAccount, HttpServletRequest request) throws AppException;
}
